package com.reremouse.rerebbs.dao.impl;

import com.reremouse.model.AdvModel;
import com.reremouse.rerebbs.dao.IAdvDAO;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.io.Serializable;
import java.util.List;

public class AdvDAO
        implements IAdvDAO, Serializable {
    @PersistenceContext
    private EntityManager entityManager;

    public EntityManager getEntityManager() {
        return this.entityManager;
    }

    public void setEntityManager(EntityManager entityManager) {
        this.entityManager = entityManager;
    }

    public List<AdvModel> findAllAdv() {
        String q = "Select ass from AdvModel ass";
        List<AdvModel> ys = this.entityManager.createQuery(q).getResultList();
        return ys;
    }

    public void updateAdvModel(AdvModel am) {
        this.entityManager.merge(am);
    }

    public AdvModel findAdv(long id) {
        AdvModel a = (AdvModel) this.entityManager.find(AdvModel.class, Long.valueOf(id));
        return a;
    }
}



/* Location:           F:\jsp源码\蝙蝠论坛系统\rerebbs\WEB-INF\classes\

 * Qualified Name:     com.reremouse.rerebbs.dao.impl.AdvDAO

 * JD-Core Version:    0.7.0.1

 */